const state = {
  pageLoading: false, // 页面加载状态
  system: 0 //系统监控使用率
}
const getters = {
  pageLoading: state => state.pageLoading, // 页面加载状态
  system: state => state.system // 系统监控使用率
}
const mutations = {
  /**
   * 页面开始加载
   * @param state
   */
  page_load_start: state => state.pageLoading = true,
  /**
   * 页面结束加载
   * @param state
   */
  page_load_end: state => state.pageLoading = false,
  /**
   * 设置系统监控使用率
   * @param state
   * @param payload
   */
  system: (state, payload) => state.system = payload
}
const actions = {
  /**
   * 页面开始加载
   * @param commit
   */
  page_load_start({ commit }) {
    commit('page_load_start')
  },
  /**
   * 页面结束加载
   * @param commit
   */
  page_load_end({ commit }) {
    commit('page_load_end')
  },
  /**
   * 设置系统监控使用率
   * @param commit
   * @param payload
   */
  system({ commit }, payload) {
    commit('system', payload)
  }
}
export default {
  state,
  mutations,
  actions,
  getters
}
